#include <iostream>
#include <vector>
using namespace std;

class Solution {
public:
    int minFlips(int a, int b, int c)
    {
        int ret = 0;
        for (int i = 0; i < 32; i++)
        {
            int x = (a >> i) & 1;
            int y = (b >> i) & 1;
            int z = (c >> i) & 1;
            if ((x | y) != z)
            {
                if (x == 1 && y == 1)
                    ret += 2;
                else
                    ret += 1;
            }
        }

        return ret;
    }
};